package com.jeff.android.lab.database.room;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;

import java.util.List;

/**
 * @author: dingfeng
 * @date: 2019-11-04
 * @since: 1.0.0
 **/
@Dao
public interface UserDao {

    @Query("select * from User")
    List<User> getAll();

    @Query("select * from User where id = :id")
    User query(int id);

    @Delete
    void delete(User user);

    @Insert
    void insert(User user);

    @Insert
    void insert(User... users);

}
